package com.krediti.session;

import java.util.Arrays;
import java.util.List;

import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityQuery;

import com.krediti.entity.Valuta;

@Name("valutaList")
public class ValutaList extends EntityQuery<Valuta> {

	/**
	 * Generated serial version.
	 */
	private static final long serialVersionUID = 4982545987352748388L;

	private static final String[] RESTRICTIONS = {
			"lower(valuta.naziv) like concat(lower(#{valutaList.valuta.naziv}),'%')",
			"lower(valuta.oznaka) like concat(lower(#{valutaList.valuta.oznaka}),'%')",
			"lower(valuta.sifra) like concat(lower(#{valutaList.valuta.sifra}),'%')", };

	private Valuta valuta = new Valuta();

	@Override
	public String getEjbql() {
		return "select valuta from Valuta valuta";
	}

	@Override
	public Integer getMaxResults() {
		return 5;
	}

	public Valuta getValuta() {
		return valuta;
	}

	@Override
	public List<String> getRestrictions() {
		return Arrays.asList(RESTRICTIONS);
	}

}
